#include "SysCommons.h"
#include "Element.h"

Element::Element() 
:value("") {

}
Element::~Element() {
	for(child_it i = children.begin(); i != children.end(); ++i) {
		Element *e = *i;
		delete e;
	}
	children.clear();
}

void Element::attachChild(Element *child) {
	children.push_back(child);
}

void Element::serialize(std::ostream &of) {
	for(child_it i = children.begin(); i != children.end(); ++i) {
		(*i)->serialize(of);
	}
}